<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    let arrayNums = [4, 9, 5, 3, 20, 6, 15, 11]
    let max = arrayNums[0]
    for (let i = 0; i < arrayNums.length; i++) {
      if (max < arrayNums[i]) {
        max = arrayNums[i]
      }
    }
    console.log(max)
  </script>
</body>
</html>